package br.com.cobranca.factory;

import br.com.caelum.vraptor.ioc.ApplicationScoped;
import br.com.caelum.vraptor.ioc.Component;
import br.com.cobranca.model.BancoBrasil;
import br.com.cobranca.model.Bradesco;
import br.com.cobranca.model.HSBC;
import br.com.cobranca.model.interfaces.Banco;

@Component
@ApplicationScoped
public class fabricaBancos {

	public Banco bancoFactory(String banco){
		if (banco.equals("BancoDoBrasil")) {
			return new BancoBrasil();
		} else if (banco.equals("Bradesco")) {
			return new Bradesco();
		} else if (banco.equals("HSBC")) {
			return new HSBC();
		} else {
			throw new IllegalArgumentException("Banco Indisponivel");
		}
	}
	
}
